template<class T> 
class Singleton
{
public:
	Singleton()
	{
		mSingleton = static_cast<T*>(this);
	}
	virtual ~Singleton() {
		mSingleton = 0;
	}
	static T& GetSingleton(){
		return *mSingleton;
	}
	static T* GetSingletonPtr(){ 
		return mSingleton;
	}
protected:
	static T* mSingleton;
};

#define initialiseSingleton( type ) \
	template <> type * Singleton < type > :: mSingleton = 0
